package com.droid.library.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.droid.library.app.App;
import com.droid.library.utils.app.DeviceUtils;
import com.droid.library.utils.app.PixelUtil;
import com.xinye.lib.R;


/**
 * 自定义Dialog基类
 *
 * @author wangheng
 */
public abstract class AbsDialog extends Dialog {


    public AbsDialog(@NonNull Context context) {
        super(context, R.style.DialogStyle);
    }

    protected AbsDialog(@NonNull Context context,
                        boolean cancelable,
                        @Nullable OnCancelListener cancelListener) {
        super(context, R.style.DialogStyle);
        setCancelable(cancelable);
        setOnCancelListener(cancelListener);
    }

    @Override
    public void show() {
        if(isShowing()){
            return;
        }
        super.show();
    }

    @Override
    public void dismiss() {
        if(!isShowing()){
            return;
        }
        super.dismiss();
    }

}
